﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title> UTN | MIG </title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<link href="Content/default.css" rel="stylesheet" type="text/css" media="screen" />
<link href="../Content/jquery-ui-1.10.3.custom/css/swanky-purse/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Tangerine">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<link href="../Content/default.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="../resources/demos/style.css" />
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<section id="main">
            @RenderBody()
        </section>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


<script type="text/javascript">

    //////////////////////script Login////////////////////////

    $(document).ready(function () {
        var state = true;


        $(this).delay(800);

        runEffect();

        $("#reg-btn").click(function () {

            $("#profile-info").animate(
	  	    {
	  	        width: 0,
	  	        height: 0,
	  	        opacity: 0.0
	  	    }, 1500, function () {

	  	        $("#profile-info").load('@Url.Action("Registration","Account")', null, function () { })
                .animate(
                    {
                        margin: "20px 0px 0px 0px",
                        width: 500,
                        height: 450,
                        opacity: 1.0
                    }, 1500, function () {
                        $(this).children().fadeIn(1000);
                    });

	  	    });

        });

        function ajax_update(path, controlId) {
            $.ajax({
                type: "POST",
                url: path,
                dataType: "html",
                success: function (result) {
                    $('#' + controlId).html(result);
                }
            });
            return false;
        }

        $("#loginBtn").click(function () {

            var object = {

                userName: $('#user-input').val(),
                password: $('#pass-input').val(),
                remember: $('#remember-input').val()
            };

            $.ajax({
                type: "POST",
                url: '@Url.Action("LogOn","Account")',
                data: JSON.stringify(object),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data) {
                        window.location = '@Url.Action("DashBoard","Home")';
                    }
                }
            });

        });

        function runEffect() {
            // get effect type from
            //$( "#logo-container" ).toggle("scale", 1000);	  
            if (state) {
                $("#logo").animate(
	  	{
	  	    background: 'url( ../Content/img/icons/logo.png) no-repeat center top',
	  	    width: 500,
	  	    height: 500,
	  	    opacity: 1.0,
	  	    left: 0,
	  	    top: 0
	  	}, 3000, function () {
	  	    $('#profile-info:hidden').fadeIn('slow');
	  	});
                state = !state;
            }
            else {
                $("#logo").animate(
	  	{
	  	    width: 0,
	  	    height: 0
	  	}, 3000, function () { });
                state = !state;
            }
        };

    });

    /////////////////////////////////////////////////////////////

    //////////////////////script DashBoard////////////////////////

    $(document).ready(function () {
        var state = true;

        $("#logOff").click(function () {
            $.ajax({
                type: "POST",
                url: '@Url.Action("LogOff","Account")',
                data: "",
                contentType: "application/json; charset=utf-8",
                dataType: "html",
                success: function (data) {
                    if (data) {
                        window.location = 'Index';
                    }
                }
            });
            //            $('#Dashboard').load('prueba.html');
        });

        $(function () {
            var menu = $("#menu").menu();
        });

        $("#datepicker").datepicker({
            inline: true
        });

        $('#a-window').click(function () {
            OpenWindow();
        });

    });

    function OpenWindow()
    {
        $("#Dashboard").html('<div id="window" class="window" style="display:none"></div>');
        $("#window").fadeIn();
        $("#window").animate(
        {
            width: "95%",
            height: "95%"
        }, 3000, null);
    }
</script>
</html>

